<template>
    <el-dialog custom-class="chat-dialog" :title="chat ? chat.user.xingming : '聊天内容'" :visible.sync="visible" append-to-body width="60%" center :before-close="beforeClose">
        <e-chat-session></e-chat-session>
    </el-dialog>
</template>
<style type="type/scss" lang="scss">
.chat-dialog{
  .el-dialog__body{
    padding: 0!important;
  }
}
</style>
<script>
export default {
    name: "e-chat-dialog",
    data() {
        return {}
    },
    watch: {},
    computed: {
        chat(){
            return this.$store.state.chat.currentChat
        },
        visible:{
            get(){
                return this.$store.state.chat.visibleModel
            },
            set(val){
                this.$store.commit('chat/setModel' , val);
            }
        }
    },
    methods: {
        beforeClose(next){
            this.$store.dispatch("chat/selectChat" , null)
            next()

        }
    },
    created() {
    },
    mounted() {
    },
    destroyed() {
    }
}
</script>
